[LINUX] Properly trigger XenbusStateClosed in blkfront
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 30 Nov 2006 17:34:48 +0000 (17:34 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 30 Nov 2006 17:34:48 +0000 (17:34 +0000)
In some situations, like when error happens in block attach for
a guest in dom0, backend send us XenbusStateClosing notification.
However, as frontend were never properly initialized, it fails
to change its own state to XenbusStateClosed, leaving the system
in a dead-end state.

Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c

index 95cff46ff92be0a162f18a0b9c2941dcd283ba14..6b7100a1bc99042ecb3624bc37ee96d1de27ebca 100644 (file)
@@ -359,7 +359,7 @@ static void blkfront_closing(struct xenbus_device *dev)
        DPRINTK("blkfront_closing: %s removed\n", dev->nodename);
 
        if (info->rq == NULL)
-               return;
+               goto out;
 
        spin_lock_irqsave(&blkif_io_lock, flags);
        /* No more blkif_request(). */
@@ -373,6 +373,7 @@ static void blkfront_closing(struct xenbus_device *dev)
 
        xlvbd_del(info);
 
+ out:
        xenbus_frontend_closed(dev);
 }